var currentArc;

window.addEvent('domready', function(){
	
	
	
	
	var searchForm = document.id('SearchForm');
	searchForm.getElements('[type=text], textarea').each(function(el){
		new OverText(el, {labelClass: 'OverTxt'});
	});
	
	var verSlide = new Fx.Tween('MenuItem');
	var header = document.id('Header');
	header.getElements('.MenuArc').each(function(el, index){
		el.addEvent('click', function(e){
			e.stop();
			var obj = header.getElements('.MenuDetail');
			var item = obj[index];
			verSlide.cancel();
			if (item) {
				if (currentArc == item) {
					currentArc = null;
					this.setProperty('class', 'MenuArc');
					verSlide.start('height', 0);
				} else {
					currentArc = item;
					obj.setStyle('display', 'none');
					item.setStyle('display', 'block');
					header.getElements('.MenuArc').setProperty('class', 'MenuArc');
					this.setProperty('class', 'MenuArc MenuArcSel');
					verSlide.start('height', item.getSize().y);
				}
			}
		});
	});
	header.getElements('.MenuCloseHref').addEvent('click', function(e){
		e.stop();
		verSlide.cancel();
		currentArc = null;
		verSlide.start('height', 0);
		header.getElements('.MenuArc').setProperty('class', 'MenuArc');
	});
});


